//@flow


/**
 * 登陆页
 * 
 * 登陆账号支持：1，普通无规则账号+密码 2，手机+验证码/手机+密码/邮件+密码 账号登陆
 * 
 * 第三方登陆支持，取决于是否有第三方配置key 取决于手机是否安装相应软件
 * 
 * 默认均为记住密码
 * 
 */

import React, { Component } from 'react';
import { 
    View,
    ScrollView,
    Text,
    KeyboardAvoidingView,
    Image,
    TouchableOpacity,
 } from 'react-native';
import LinearGradient from "react-native-linear-gradient";
import { IconHeader } from './iconHeader';
import { LoginInput, LoginForm } from './loginForm';
import { touchDismissKeyBoard } from '../../base/touchDismissKeyboardHOC';
import { PageBase } from '../../base/pageBase';
import { Navigate } from '../../common/navigate';
import Orientation from "react-native-orientation";
import { Loading } from '../../container/loading/loading';
import { VersionNumber } from "../../component/version/versionNumber.view";
import { Counter } from '../../component/counter/counter.view';
import { Version } from '../../component/version/version.view';
import { DebugBtn } from '../../container/debugController/debugBtn';
import { RequestAnalyzer } from '../../container/requestAnalyzer/requestAnalyzer';
import { NavBar } from '../../container/navBar';
import { UserLoginCancelReason } from "../../common/navigate";
type Props = {
    fromPageName : string,//从哪个页面来的
}

export type NavigationProps = {
    onLoginCancel : (reason:UserLoginCancelReason)=>{},//用户登陆取消时候的，并且返回取消原因,
    onLoginSuccess: ()=>{},//用户登陆成功将要进行的操作
}

@touchDismissKeyBoard
export class Login extends Component <Props,{}>{
    
    componentDidMount(){
        // Orientation.lockToLandscape()
    }
    render(){
        return(
            <View>
                <LinearGradient colors={['rgb(142,193,250)', 'rgb(250,198,128)']} style={{width:'100%',height:'100%'}}>
                    <NavBar titleView="登陆"/>
                    <IconHeader style={{backgroundColor: 'rgba(0,0,0,0)',}}/>
                    <KeyboardAvoidingView behavior="padding" style={{flex:1}}>
                        <LoginForm style={{paddingHorizontal:40,flex:1}}/>
                    </KeyboardAvoidingView>
                </LinearGradient>
            </View>
        )
    }
}


